import 'package:bitcatflutter/page/home_skeleton/tab_page.dart';
import 'package:flutter/material.dart';

class SkeletonHome extends StatefulWidget {
  const SkeletonHome({super.key});

  @override
  State<SkeletonHome> createState() => _SkeletonHomeState();
}

class _SkeletonHomeState extends State<SkeletonHome> with SingleTickerProviderStateMixin {

  var tabList = [
    "新闻","体育","军事","科技","教育","文学","历史"
  ];
  late TabController _tabController;

  @override
  void initState() {
    super.initState();
    _tabController = TabController(length: tabList.length, vsync: this);
  }

  @override
  Widget build(BuildContext context) {
    return Container(
      padding: EdgeInsets.symmetric(vertical: 10,horizontal: 0),
      child: Column(
        children: [
          TabBar(
              controller: _tabController,
              isScrollable: true,
              tabs: tabList.map((e) => TabPage(title: e,)).toList()),
        ],
      ),
    );
  }
}
